//
//  WFBaseTableViewCell.m
//  谷居
//
//  Created by dllo on 16/6/16.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFBaseTableViewCell.h"

@implementation WFBaseTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setColor];
        [self addObserver];
    }
    return self;
}


- (void)setColor {
    if (!IS_LONG) {
        self.contentView.backgroundColor = DAY_COLOR;
    } else {
        self.contentView.backgroundColor = NIGHT_COLOR;
    }

}

- (void)addObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeToNight:) name:@"夜间模式" object:nil];

}
-(void)changeToNight:(NSNotification *)sender {
    if (!IS_LONG) {
        self.contentView.backgroundColor = NIGHT_COLOR;
    } else {
        self.contentView.backgroundColor = DAY_COLOR;
    }
}
- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];

    [super dealloc];
}
@end
